Jump to content
McKay Development

Recommended Posts

Posted

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?

Posted

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');

 

Posted

thanks for the quick reply, works fine thanks, 

in the current released version nor these message ids are neither in language.js , should they be added?
 

also the current release doesn't have Protos.CMsgCasketItem but it is in master.

Thanks for your help and have a good day

 

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...