예제 #1
0
 public void GotMessage(MMCMessage message)
 {
     //NetIncomingMessage msg = s_server.ReadMessage();
     if (message == null)
         return;
     Output(message.ToString());
     if (message.Type.Contains(DataType.CHARACTER) && s_server.pConfig.type == PeerType.CHARACTER)
     {
         MMCCharacter character = message.CharacterData;
         pictureBox1.Load(character.PreviewImage.ToString());
     }
 }
예제 #2
0
 //Should it be a problem, filtering message based on the client's state?
 private MMCMessage FilterMessage(MMCMessage msg)
 {
     return msg;
 }
예제 #3
0
 public void SendToClient(ClientValue cv, MMCMessage message)
 {
     foreach (KeyValuePair<ClientValue, NetConnection> kv in this.ConnectedClients)
     {
         if (kv.Key.Equals(cv))
             this.SendMessage(message, kv.Value);
     }
 }
예제 #4
0
 public void SendToAll(PeerType type, MMCMessage message)
 {
     foreach (KeyValuePair<ClientValue, NetConnection> kv in this.ConnectedClients)
     {
         if (kv.Key.Value[0] == type.ToString())
             this.SendMessage(message, kv.Value);
     }
 }
예제 #5
0
 public void SendMessage(MMCMessage message, NetConnection connection)
 {
     NetOutgoingMessage msg = this.CreateMessage();
     msg.Write(JsonConvert.SerializeObject(message));
     this.SendMessage(msg, connection, NetDeliveryMethod.ReliableOrdered);
 }
예제 #6
0
 public void GotMessage(MMCMessage msg)
 {
     //NetIncomingMessage msg = s_server.ReadMessage();
     if (msg == null)
         return;
 }
예제 #7
0
        private void button7_Click(object sender, EventArgs e)
        {
            MMCMessage message = new MMCMessage();
            MMCCharacter character = new MMCCharacter();
            character.ModelAPI = textBox1.Text;
            character.MotionAPI = "532ed403672d3";
            character.Name = "Racing Miku";
            character.UseClientModel = false;
            character.UseClientMotion = false;
            character.UseClientRender = false;
            message.Status = ReturnStatus.OK;
            message.Type = new DataType[] { DataType.CHARACTER };
            message.CharacterData = character;
            string id = character.Finalize();

            Output("sending: " + id);
            Output("====decoded id====");
            Output(MMCCharacter.Base64Decode(id));

            MMCMessage message1 = new MMCMessage();
            MMCControl control = new MMCControl();
            control.Type = ControlType.BASIC;
            control.BasicControl = BasicControl.LOCK;
            message1.ControlData = control;
            message1.Type = new DataType[] { DataType.CONTROL };

            s_server.SendToAll(PeerType.CHARACTER, message);
            //Output("sending to: " + s_server.GetConnectionInfo(c).Value[0] + "@" + s_server.GetConnectionInfo(c).Value[1]);
            s_server.SendToAll(PeerType.SFX, message1);
            //Output("sending to: " + s_server.GetConnectionInfo(c).Value[0] + "@" + s_server.GetConnectionInfo(c).Value[1]);
        }