« [Client Side] Sending data + DecUI
create_actor

habi

  • Sr. Member
  • Posts: 287
Re: create_actor
« Reply #15,  »Last edited
i was making a video the whole day. https://youtu.be/bVWGU4Ph6Fs
it's about setting up python, scapy etc etc
Quote
Unfortunately, no. I don't really understand how this works
@DMWarrior
Well, the packet data is an array. length is about 30, but can be more.

Actually the length is some 90 because,
first 20----- storing machine ids of source, machine id of destination etc etc
second 20.----ip address of source, destination,
third 20----source port destination port
last 30-----Raknet data---this is what we want.
also 20+ 20+ 20+ 30 = 90

So the array. each element of array is an integer between 0 and 255, which is represented by ff bf ae etc in packet capturing softwares.

I will post some image of it sometimes later.

MEGAMIND

  • Hero Member
  • Developer of Webnet Official
  • Posts: 803
Re: create_actor
« Reply #16,  »
hey that nodejs thing is really cool i did lots of stuff this night, btw i would like to know why are the pings of bot soooo high like they range from 30000 to almost like 50000, is there a solution to it(Would be helpfull)

habi

  • Sr. Member
  • Posts: 287
Re: create_actor
« Reply #17,  »Last edited
Quote from MEGAMIND on May 2nd, 2020, 12:02 AM
hey that nodejs thing is really cool i did lots of stuff this night, btw i would like to know why are the pings of bot soooo high like they range from 30000 to almost like 50000, is there a solution to it(Would be helpfull)
I had noticed it and thought about reducing it.
Every two seconds or so, the server sends a ping packet to client. the packet contain a timestamp. client receives it and sends another packet called pong. this packet contain the old timestamp.
when it reaches server the server subtract the current time with the time it send old packet with the timestamp shown in pong packet. usually it is 300 or 400.
But in our case, we are replaying, the timestamp of pong packets of client are those when we recorded it.
we couldn't get a live timestamp from server.

hence the ping shown is very high. but actually it is not so.

if you want to reduce it, we must sniff the server packet, find it's data like timestamp and inject this to our recorded packets.

It goes like that..

umar4911

  • Hero Member
  • Creating own server!
  • Posts: 519
Re: create_actor
« Reply #18,  »
@habi
not used to python. Here is an error popped on creating actor.

Code: [Select]
Exception in thread Thread-2:
Traceback (most recent call last):
  File "C:\Users\Umar\AppData\Local\Programs\Python\Python38-32\lib\site-packages\scapy-git_archive.devd9fbc7240b-py3.8.egg\scapy\arch\windows\__init__.py", line 693, in dev_from_name
    return next(iface for iface in six.itervalues(self)
StopIteration

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Umar\AppData\Local\Programs\Python\Python38-32\lib\site-packages\scapy-git_archive.devd9fbc7240b-py3.8.egg\scapy\arch\windows\__init__.py", line 772, in pcapname
    return IFACES.dev_from_name(dev).pcap_name
  File "C:\Users\Umar\AppData\Local\Programs\Python\Python38-32\lib\site-packages\scapy-git_archive.devd9fbc7240b-py3.8.egg\scapy\arch\windows\__init__.py", line 696, in dev_from_name
    raise ValueError("Unknown network interface %r" % name)
ValueError: Unknown network interface 'Npcap Loopback Adapter'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Umar\AppData\Local\Programs\Python\Python38-32\lib\site-packages\scapy-git_archive.devd9fbc7240b-py3.8.egg\scapy\arch\windows\__init__.py", line 701, in dev_from_pcapname
    return next(iface for iface in six.itervalues(self)
StopIteration

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Umar\AppData\Local\Programs\Python\Python38-32\lib\threading.py", line 932, in _bootstrap_inner
    self.run()
  File "C:\Users\Umar\AppData\Local\Programs\Python\Python38-32\lib\threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "E:\vcmp\sqmod\movie server\Actor script\scripts\main.py", line 228, in create_actor
    send(p, verbose=True,iface=interface);
  File "C:\Users\Umar\AppData\Local\Programs\Python\Python38-32\lib\site-packages\scapy-git_archive.devd9fbc7240b-py3.8.egg\scapy\sendrecv.py", line 345, in send
    socket = socket or conf.L3socket(*args, **kargs)
  File "C:\Users\Umar\AppData\Local\Programs\Python\Python38-32\lib\site-packages\scapy-git_archive.devd9fbc7240b-py3.8.egg\scapy\arch\pcapdnet.py", line 332, in __init__
    self.ins = open_pcap(iface, MTU, self.promisc, 100,
  File "C:\Users\Umar\AppData\Local\Programs\Python\Python38-32\lib\site-packages\scapy-git_archive.devd9fbc7240b-py3.8.egg\scapy\arch\windows\__init__.py", line 799, in open_pcap
    iface_pcap_name = pcapname(iface)
  File "C:\Users\Umar\AppData\Local\Programs\Python\Python38-32\lib\site-packages\scapy-git_archive.devd9fbc7240b-py3.8.egg\scapy\arch\windows\__init__.py", line 774, in pcapname
    return IFACES.dev_from_pcapname(dev).pcap_name
  File "C:\Users\Umar\AppData\Local\Programs\Python\Python38-32\lib\site-packages\scapy-git_archive.devd9fbc7240b-py3.8.egg\scapy\arch\windows\__init__.py", line 704, in dev_from_pcapname
    raise ValueError("Unknown pypcap network interface %r" % pcap_name)
ValueError: Unknown pypcap network interface 'Npcap Loopback Adapter'
Have npcap installed and socket connection was successfull too
I am gamer, programmer and hacker. Try to find me!
xD

habi

  • Sr. Member
  • Posts: 287
Re: create_actor
« Reply #19,  »
hi umar, i am happy that you are using this.

open cmd, type scapy
scapy will open up
then enter this command
Code: [Select]
conf.auto_crop_tables=False; IFACES;



Look for name something containing 'Loopback'.  In the image it is Software Loopback Interface 1

Copy its entire name. This is your correct interface name.

Now, open main.py change12th line
interface='Software Loopback Interface 1'
( # is used for commenting in python )

let me know if it works.

umar4911

  • Hero Member
  • Creating own server!
  • Posts: 519
Re: create_actor
« Reply #20,  »
Quote from habi on May 3rd, 2020, 04:19 PM
hi umar, i am happy that you are using this.

open cmd, type scapy
scapy will open up
then enter this command
Code: [Select]
conf.auto_crop_tables=False; IFACES;



Look for name something containing 'Loopback'.  In the image it is Software Loopback Interface 1

Copy its entire name. This is your correct interface name.

Now, open main.py change12th line
interface='Software Loopback Interface 1'
( # is used for commenting in python )

let me know if it works.
connection successful but the issue is the player didn't connect to the server, printing player as null
Code: [Select]
AN ERROR HAS OCCURED [the index 'ID' does not exist]

CALLSTACK
*FUNCTION [onBotCommand()] scripts/actor.nut line [25]
*FUNCTION [dR()] scripts/actor.nut line [8]

LOCALS
[player] NULL
[skin] 0
[botID] 0
[name] "tommy"
[params] ARRAY
[i] 5
[text] "tommy 0 0"
[cmd] "created"
[this] TABLE
[text] "tommy 0 0"
[cmd] "created"
[i] 7
[data] "created tommy 0 0"
[this] TABLE

python printed sent 1 packets
I am gamer, programmer and hacker. Try to find me!
xD

habi

  • Sr. Member
  • Posts: 287
Re: create_actor
« Reply #21,  »
1. Is your server running on port 8192?
What was the interface name you found?

umar4911

  • Hero Member
  • Creating own server!
  • Posts: 519
Re: create_actor
« Reply #22,  »
Quote from habi on May 4th, 2020, 05:15 AM
1. Is your server running on port 8192?
What was the interface name you found?
was using port 8194. Changed to 8192 and worked.
I am gamer, programmer and hacker. Try to find me!
xD

MEGAMIND

  • Hero Member
  • Developer of Webnet Official
  • Posts: 803
Re: create_actor
« Reply #23,  »Last edited
hey everyone...! ive been playing with nodejs npcs, lel they are awsome, ive tested them with almost many minigames and side game in my server, made them do lots of stupid an funny stuff, but the thing is at alomost 3-4 npcs the server gets crashed after each bot has done its task, why does it happen

habi

  • Sr. Member
  • Posts: 287
Re: create_actor
« Reply #24,  »Last edited
Quote from MEGAMIND on May 4th, 2020, 05:20 PM
.....but the thing is at alomost 3-4 npcs the server gets crashed after each bot has done its task, why does it happen
on blank server?

MEGAMIND

  • Hero Member
  • Developer of Webnet Official
  • Posts: 803
Re: create_actor
« Reply #25,  »
Quote from habi on May 4th, 2020, 06:06 PM
Quote from MEGAMIND on May 4th, 2020, 05:20 PM
.....but the thing is at alomost 3-4 npcs the server gets crashed after each bot has done its task, why does it happen
on blank server?
on TDCS server, blank would obviously make no issues but what if people adapt this method on there server so there server will get crashed in an hour/after an hour

KX

  • Newbie
  • Posts: 13
Re: create_actor
« Reply #26,  »
Quote from MEGAMIND on May 4th, 2020, 07:31 PM
Quote from habi on May 4th, 2020, 06:06 PM
Quote from MEGAMIND on May 4th, 2020, 05:20 PM
.....but the thing is at alomost 3-4 npcs the server gets crashed after each bot has done its task, why does it happen
on blank server?
on TDCS server, blank would obviously make no issues but what if people adapt this method on there server so there server will get crashed in an hour/after an hour
If working on blank script then something is wrong with your script or you are doing something wrong.

MEGAMIND

  • Hero Member
  • Developer of Webnet Official
  • Posts: 803
Re: create_actor
« Reply #27,  »
Quote from KX on May 5th, 2020, 03:07 AM
Quote from MEGAMIND on May 4th, 2020, 07:31 PM
Quote from habi on May 4th, 2020, 06:06 PM
Quote from MEGAMIND on May 4th, 2020, 05:20 PM
.....but the thing is at alomost 3-4 npcs the server gets crashed after each bot has done its task, why does it happen
on blank server?
on TDCS server, blank would obviously make no issues but what if people adapt this method on there server so there server will get crashed in an hour/after an hour
If working on blank script then something is wrong with your script or you are doing something wrong.
pff my script is all okay + its a nodejs which means its a player connection from an other localhost theres no relation of script in it.. kindly dont interfair when u dont have knowledge about packets

habi

  • Sr. Member
  • Posts: 287
Re: create_actor
« Reply #28,  »
Megamind, there is something else.
Remember, we are sending recorded packets and if the server asks for something ( with the player pointer ), we are not giving answers. so it will crash. You have to start with blank script.

MEGAMIND

  • Hero Member
  • Developer of Webnet Official
  • Posts: 803
Re: create_actor
« Reply #29,  »Last edited
Quote from habi on May 5th, 2020, 12:17 PM
Megamind, there is something else.
Remember, we are sending recorded packets and if the server asks for something ( with the player pointer ), we are not giving answers. so it will crash. You have to start with blank script.
hey habi.. nice to see you, no actually its all okay nothing goes wrong it all happens after 5 hours or 6 hours, well i see that nodejs bots when recorded and played the just do that work for once, so to make them loop over i made small script in batch.bat file something like this which makes bots reconnect to server and loop over again and again, its something like this

start.bat
Code: [Select]
:a
start play.bat
Timeout /T 180 /nobreak >nul
taskkill /F /fi "WINDOWTITLE eq vcmpbots*"
taskkill /F /IM node.exe
Timeout /T 12 /nobreak >nul
goto a

play.bat
Code: [Select]
title vcmpbots
start /B node play.js Hunter_Bot
start /B node play.js Tank_Bot
, well i had to adapt this method for my bots to reconnect as they should loop by themselves but they were not doing like it, so i created these bat files to do the work, well if there is an alternate to it! i mean if the bots loops by itself let me know how and when does it doo that after how many intervals of time, if it doesnt loop by its self so i think bat files arent an issue, well ill try it on a blank server as well, but to be honest TDCS is all okay and theres no such issue why..? bcz nodejs are just like a normal player connecting again and again...

« [Client Side] Sending data + DecUI