Example #1
0
    public void HandleMsg(System.Object state, TNetMsg msg)
    {
        TunerMessage.TMLogin temp = TunerMessage.TMLogin.Deserialize(msg.m_DataMsg);
        System.Console.WriteLine(msg.m_nMsgID.ToString() + "__" + temp.Username + "____" + temp.Password);
        //send the message to the particular message system.


        //test send
        Agent tempClient = Server.Instance.getClient((int)state);

        TunerMessage.TMLoginOut tempMsg = new TunerMessage.TMLoginOut();
        tempMsg.Nickname = "yyss";
        MemoryStream mem = new MemoryStream();

        TunerMessage.TMLoginOut.Serialize(mem, tempMsg);

        tempClient.SendMessage(7, mem);
    }
Example #2
0
    void testSend()
    {
//
//  TunerMessage.TMLogin temp = new TunerMessage.TMLogin();
//  temp.username = "******";
//   temp.password = "******";
//    TNetMgr.Instance.SendNetMessage<TunerMessage.TMLogin>(1, temp);

        TunerMessage.TMLogin temp = new TunerMessage.TMLogin();
        temp.Username = "******";
        temp.Password = "******";

        MemoryStream tempStream = new MemoryStream();

        TunerMessage.TMLogin.Serialize(tempStream, temp);



        Client.Instance.SendMessage(1, tempStream);

        // TunerMessage.TMLogin.Serialize()
    }