Iris2.de

Iris2-Forum
It is currently Wed Dec 02, 2020 1:21 am

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Fri May 22, 2009 8:35 am 
Offline
Power User
User avatar

Joined: Fri Apr 17, 2009 2:32 pm
Posts: 122
Tyrin To Implement A Custom Package But Can't..

I Can Sent A Package Client to Server but Can't Send Server to Client...

Following That Way:
lib.packet.lua

adding:
Code:
gPacketType.kPacket_Verification_Request                            = { id=0xFA, size=2 }


and

net.other.lua
adding:
Code:
function gPacketType.kPacket_Verification_Request()
    print("######################### Verification Requested");
end


And Server Side
Code:
public sealed class VerificationRequest : Packet
    {
        public VerificationRequest()
            : base(0xFA, 2)
        {
            Console.WriteLine("Sending Verification Request.");
            m_Stream.Write((bool)true);
            m_Stream.Fill();
        }
    }


//And Sending Packet To Client.
Code:
static void EventSink_Login(LoginEventArgs e)
        {
            e.Mobile.Send(new VerificationRequest());
        }


Console Outputs: Sending Verification Request.

But Client Command Output Is Not Working, it must be: ######################### Verification Requested

Where I'm Doing Wrong?

Regards.


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 22, 2009 10:26 am 
Offline
iris2-developer
User avatar

Joined: Tue Aug 22, 2006 1:21 pm
Posts: 173
Location: Munich, Germany
try
Code:
function gPacketHandler.kPacket_Verification_Request()

instead of
Code:
function gPacketType.kPacket_Verification_Request()

_________________
O-->---


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 22, 2009 3:24 pm 
Offline
iris2-developer
User avatar

Joined: Tue Apr 18, 2006 10:28 pm
Posts: 823
Location: Munich, Bavaria, Germany
you have to pop the messaga data completely in the packet handler.

also instead of introducing new fixed size packets, i'd recommend using new subpackets of 0xBF , see iris/lua/net/net.generic.lua

for those.


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 22, 2009 6:46 pm 
Offline
Power User
User avatar

Joined: Fri Apr 17, 2009 2:32 pm
Posts: 122
thanks for replies resolved.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group