QuestionHelpPong Packet?

Posts 1–7 of 7 · Page 1 of 1
Pong Packet?
Hai guise, I'm writing a RotMG Bot in C# and I'm having trouble with the PongPacket, I know that after I get a PingPacket I should send a pong packet, if I do so I get a Protocol error, I guess its because I'm not sending the right time, so anyone know how do I get the time.

@nilly @krazyshank @JustAnoobROTMG @Botmaker maybe?
i tink u shud ask me im mastr coderz
current time - start time?
Quote Originally Posted by mSteaker View Post
current time - start time?
I have that, but I don't know when the starttime is set, can u tell me <3
this might help

time functions
Code:
global function get_tick_count()
  return  w32Func(xGetTickCount,{})
end function

global atom start_time
start_time=get_tick_count()

global function current_time()
  return  w32Func(xGetTickCount,{})-start_time
end function

Ping received, pong sent back instantly
Code:
procedure ping_packet_read(integer client,integer inputstream)
  object res
  sequence write,temp
  res=input_stream_readint(inputstream)

  write=""
  write=writeint(write,res) --serial
  write=writeint(write,current_time()) --time

  temp=reverse(int_to_bytes(length(write)+5)) &pong_packet
  write=rc4_arcfour_encrypt_block(client_list[client][client_rc4_2],write)
  socket_send_data(client,temp&write)
end procedure
packet_read_used[ping_packet+1]=-1
packet_read_id[ping_packet+1]=routine_id("ping_packet_read")
Quote Originally Posted by Botmaker View Post
this might help

time functions
Code:
global function get_tick_count()
  return  w32Func(xGetTickCount,{})
end function

global atom start_time
start_time=get_tick_count()

global function current_time()
  return  w32Func(xGetTickCount,{})-start_time
end function

Ping received, pong sent back instantly
Code:
procedure ping_packet_read(integer client,integer inputstream)
  object res
  sequence write,temp
  res=input_stream_readint(inputstream)

  write=""
  write=writeint(write,res) --serial
  write=writeint(write,current_time()) --time

  temp=reverse(int_to_bytes(length(write)+5)) &pong_packet
  write=rc4_arcfour_encrypt_block(client_list[client][client_rc4_2],write)
  socket_send_data(client,temp&write)
end procedure
packet_read_used[ping_packet+1]=-1
packet_read_id[ping_packet+1]=routine_id("ping_packet_read")
Quote Originally Posted by Botmaker View Post
this might help

time functions
Code:
global function get_tick_count()
  return  w32Func(xGetTickCount,{})
end function

global atom start_time
start_time=get_tick_count()

global function current_time()
  return  w32Func(xGetTickCount,{})-start_time
end function

Ping received, pong sent back instantly
Code:
procedure ping_packet_read(integer client,integer inputstream)
  object res
  sequence write,temp
  res=input_stream_readint(inputstream)

  write=""
  write=writeint(write,res) --serial
  write=writeint(write,current_time()) --time

  temp=reverse(int_to_bytes(length(write)+5)) &pong_packet
  write=rc4_arcfour_encrypt_block(client_list[client][client_rc4_2],write)
  socket_send_data(client,temp&write)
end procedure
packet_read_used[ping_packet+1]=-1
packet_read_id[ping_packet+1]=routine_id("ping_packet_read")
and when do I have to set the starttime? When I connect right?
Posts 1–7 of 7 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us