protected virtual void step1SendMessage() { sampleIO.log("Step 1 : Send RawMessage !"); NRawGameMessage rawMessage = new NRawGameMessage(); rawMessage.setContent("blabla"); gameApi.sendMessage(rawMessage); }
public void SendGameMessage(String msg, String gameID) { NRawGameMessage rawGameMessage = new NRawGameMessage(); rawGameMessage.setContent(msg); gameApi.sendMessageToGame(gameID, rawGameMessage); }
public void SpawnObject(OnlineObject ob) { //Set the owner ob.setOwner(PlayerID); //insert all json objects JObject obj = new JObject( new JProperty(KEY_OBJECT_TYPE, ob.GetType().ToString()), //obj type new JProperty(KEY_MSG_TYPE, MSG_TYPE.SPAWN.ToString()), // msg type new JProperty(KEY_OWNER, PlayerID), //the player owner new JProperty(KEY_JOBJECT, ob.getJSONObject()) //the jobject ); //set the msg content and send NRawGameMessage msg = new NRawGameMessage(); msg.setContent(obj.ToString()); SendGameMessage(msg); //add it locally addInGameObject(ob); }
public void UpdateObject(JObject obj, Type type) { //insert all json objects JObject root = new JObject( new JProperty(KEY_OBJECT_TYPE, type.ToString()), //obj type new JProperty(KEY_MSG_TYPE, MSG_TYPE.UPDATE.ToString()), // msg type new JProperty(KEY_OWNER, PlayerID), //the player owner new JProperty(KEY_JOBJECT, obj) //the jobject ); //set the msg content and send NRawGameMessage msg = new NRawGameMessage(); msg.setContent(root.ToString()); SendGameMessage(msg); }
protected virtual void sendGameMessage() { NRawGameMessage rawGameMessage = new NRawGameMessage(); rawGameMessage.setContent("i'm in the game guys"); gameApi.sendMessageToGame(game.getId(), rawGameMessage); }