コード例 #1
0
 protected virtual void step1SendMessage()
 {
     sampleIO.log("Step 1 : Send RawMessage !");
     NRawGameMessage rawMessage = new NRawGameMessage();
     rawMessage.setContent("blabla");
     gameApi.sendMessage(rawMessage);
 }
コード例 #2
0
ファイル: NugettaHandler.cs プロジェクト: ollesate/TankGame
 public void SendGameMessage(String gameID, NRawGameMessage msg)
 {
     gameApi.sendMessageToGame(gameID, msg);
 }
コード例 #3
0
ファイル: NugettaHandler.cs プロジェクト: ollesate/TankGame
 public void SendGameMessage(String msg, String gameID)
 {
     NRawGameMessage rawGameMessage = new NRawGameMessage();
     rawGameMessage.setContent(msg);
     gameApi.sendMessageToGame(gameID, rawGameMessage);
 }
コード例 #4
0
ファイル: Controller.cs プロジェクト: ollesate/TankGame
 private void SendGameMessage(NRawGameMessage msg)
 {
     nugetta.SendGameMessage(gameID, msg);
 }
コード例 #5
0
ファイル: Controller.cs プロジェクト: ollesate/TankGame
    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);
    }
コード例 #6
0
ファイル: Controller.cs プロジェクト: ollesate/TankGame
    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);
    }
コード例 #7
0
 protected virtual void sendGameMessage()
 {
     NRawGameMessage rawGameMessage = new NRawGameMessage();
     rawGameMessage.setContent("i'm in the game guys");
     gameApi.sendMessageToGame(game.getId(), rawGameMessage);
 }