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