Jump to content
McKay Development

Reusing protos


benjamsch

Recommended Posts

essentially i extended node-globaloffensive with this: 

GlobalOffensive.prototype.moveItemToCasket = function (casketId, itemId) {

   this._send(Language.MsgGCCasketItemAdd, Protos.CMsgCasketItem, {
      casket_item_id: casketId,
      item_item_id: itemId
   });
};

GlobalOffensive.prototype.removeItemFromCasket = function (casketId, itemId) {

   this._send(Language.MsgGCCasketItemExtract, Protos.CMsgCasketItem, {
      casket_item_id: casketId,
      item_item_id: itemId
   });
};

GlobalOffensive.prototype.loadCasketContents = function (casketId) {
   this._send(Language.MsgGCCasketItemLoadContents, Protos.CMsgCasketItem, {
      casket_item_id: casketId,
      item_item_id: casketId
   });
};

is it possible to send these protobufs from outside of your project?

Link to comment
Share on other sites

I have no idea if this will work, but you might try:

const Language = require('globaloffensive/language.js');
const Protos = require('globaloffensive/protobufs/generated/_load.js');

If that doesn't work, this should (provided you've installed the module in the current directory):

const Language = require('./node_modules/globaloffensive/language.js');
const Protos = require('./node_modules/globaloffensive/protobufs/generated/_load.js');

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...