Jump to content

Recommended Posts

[Mod] Server time

 

screenshot_01.png

 

The mod adds a text label with a clock to the game - the current server time.

 

The server time is taken from the packet ID: 940 that the server sends to the client upon connection, for example:

[01-17 10:44:47:879]

The clock label is bound to the minimap form "frmMinimap" from the GUI script file "\scripts\lua\forms\minimap.clu".

 

 

Requirements

 

Installed mod loading system for server and client (PKOdev.NET mod loader).

 

 

Modification information

 

Name: pkodev.mod.clock;

Version: 1.0;

Author: V3ct0r;

Type: for client (Game.exe);

Supported executable .exe files: GAME_13X_0, GAME_13X_1, GAME_13X_2, GAME_13X_3, GAME_13X_4 and GAME_13X_5.

 

 

Installation

 

1) In the "mods" directory of your client, create a "pkodev.mod.clock" folder;

2) Place into it the mod DLL file "pkodev.mod.clock.client.13x_<ID>.dll" for your version of Game.exe;

3) Place into it the mod settings file "pkodev.mod.clock.cfg" and write to the file the desired server time output format in accordance with the documentation for the strftime() function. For example, the format:

Server time: %H:%M:%S %d.%m.%y

May give the following output:

Server time: 10:51:20 17.01.2022

4) In the GUI script file "\scripts\lua\forms\minimap.clu" add the code for the "labClock" text label, which will be responsible for displaying the server time:

------------------------------------------------------------------------------------------
-- Clock label
------------------------------------------------------------------------------------------
labClock = UI_CreateCompent(frmMinimap, LABELEX_TYPE, "labClock", 20, 15, 20, 220)
UI_SetCaption(labClock, "Clock")
UI_SetTextColor(labClock, COLOR_WHITE)
UI_SetLabelExFont(labClock, DEFAULT_FONT, TRUE, COLOR_BLACK)
------------------------------------------------------------------------------------------

 

 

Download

 

1) Binary release (.dll);

2) The source code of the mod for Visual Studio 2019 Community (C++).

 

 

If you encounter any problem, bug or have any questions, then feel free to write in this thread.

  • Like 3
  • Thanks 1

Share this post


Link to post
Share on other sites

Mod update 01/26/2021

 

+ Fixed incorrect CUIInterface___FindForm address for Game.exe version GAME_13X_1;

+ Fixed a bug related to incorrect calculation of server time.

 

All [forum] users who use this mod on their servers, please update as soon as possible - links to the mod and its source code have been updated. Thanks to our participant @Fomin for the bugs found!

  • Like 1

Share this post


Link to post
Share on other sites
20 hours ago, gunnapong said:

Mods do not support the game.exe , I don't know the number, please tell me.

https://drive.google.com/file/d/1jfnNjzO8iGdNU9KTt0jfkbWaoyAkHPM5/view?usp=drivesdk

 

// BOOL	SC_CHARSTR(LPRPACKET pk)
const unsigned int SC_CHARSTR = 0x00516320;

// NetIF *g_NetIF
const unsigned int g_NetIF = 0x006F26A0;

// bool CWorldScene::_Init()
const unsigned int CWorldScene___Init = 0x004CDE50;

// void CWorldScene::_FrameMove( DWORD dwTimeParam )
const unsigned int CWorldScene___FrameMove = 0x004CF2D0;

// CUIInterface
const unsigned int CUIInterface = 0x0069A548;

// CForm* CUIInterface::_FindForm(const char * frmName)
const unsigned int CUIInterface___FindForm = 0x004A0660;

// CCompent* CForm::Find( const char* str )
const unsigned int CForm__Find = 0x00496A80;

// void CLabel::SetCaption( const char * str )
const unsigned int CLabel__SetCaption = 0x0042C570;

 


Share this post


Link to post
Share on other sites
4 hours ago, V3ct0r said:

 


// BOOL	SC_CHARSTR(LPRPACKET pk)
const unsigned int SC_CHARSTR = 0x00516320;

// NetIF *g_NetIF
const unsigned int g_NetIF = 0x006F26A0;

// bool CWorldScene::_Init()
const unsigned int CWorldScene___Init = 0x004CDE50;

// void CWorldScene::_FrameMove( DWORD dwTimeParam )
const unsigned int CWorldScene___FrameMove = 0x004CF2D0;

// CUIInterface
const unsigned int CUIInterface = 0x0069A548;

// CForm* CUIInterface::_FindForm(const char * frmName)
const unsigned int CUIInterface___FindForm = 0x004A0660;

// CCompent* CForm::Find( const char* str )
const unsigned int CForm__Find = 0x00496A80;

// void CLabel::SetCaption( const char * str )
const unsigned int CLabel__SetCaption = 0x0042C570;

 

Sorry. My version time is not right.

Share this post


Link to post
Share on other sites
On 3/6/2022 at 4:58 PM, gunnapong said:

Sorry. My version time is not right.

Hello @gunnapong,

 

I think do not understand you a bit. Can you explain in more detail what is the problem? Thank you!


Share this post


Link to post
Share on other sites
2 hours ago, V3ct0r said:

สวัสดี@gunnapong,

 

ฉันคิดว่าไม่เข้าใจคุณสักหน่อย คุณช่วยอธิบายรายละเอียดเพิ่มเติมได้ไหมว่าปัญหาคืออะไร ขอขอบคุณ!

The in-game time does not match my real time.

Share this post


Link to post
Share on other sites
On 3/12/2022 at 4:30 PM, gunnapong said:

The in-game time does not match my real time.

1) The mod displays the system time of the server, not the client (if the server and client are running on different computers);

2) What time do you see and what time is on the server?

3) It is possible that the format of the date-time string from the server has been changed in your Game.exe (in the packet with ID 940. Should be like:

[01-17 10:44:47:879]

 


Share this post


Link to post
Share on other sites

@Mesut

 

Connect to the GateServer.exe using Telnet and show the output.

Microsoft Telnet> open 127.0.0.1 1973

 

  • Like 1

Share this post


Link to post
Share on other sites

Hello @Ximboliex,

 

These mods are for official binaries only. They are incompatible with CO.

  • Thanks 1

Share this post


Link to post
Share on other sites

every single features #vektor provid you see that Requirements MODS LOADER 

what about if i have files it works with sources not mods loader what should we do x_x 

Share this post


Link to post
Share on other sites

Hello @Mario,

 

These modifications are intended for official client and server compiled binaries (.exe), not for source codes. If you are working with source code, you can implement all of these modifications directly in the your source code. Of course, the source code of pkodev.mod.loader modifications will be incompatible with your one.


Share this post


Link to post
Share on other sites
On 11/20/2022 at 5:24 AM, RafaelaMartins said:

Hi V3ct0r you know how add it in CO?

Hello!

 

You can find some functions that need to be changed in the CO sources, in the hook.h file. Also specific changes can be found in the dllmain.cpp file.

  • Like 1

Share this post


Link to post
Share on other sites
В 17.01.2022 в 09:05, V3ct0r сказал:

10:51:20 17.01.2022

i wonder if i can add this on version 700 files i mean new files whit source files visual studio 2022?

Share this post


Link to post
Share on other sites
4 hours ago, Mesut said:

i wonder if i can add this on version 700 files i mean new files whit source files visual studio 2022?

If possible, you just have to look for the part of the @V3ct0r code that is in charge of the time in the server and add it to the src of your project

  • Thanks 1

Share this post


Link to post
Share on other sites
On 11/20/2023 at 10:48 PM, Mesut said:

i wonder if i can add this on version 700 files i mean new files whit source files visual studio 2022?

Hello @Mesut,

 

The modification is designed for official 1.3x client binaries.

On 12/3/2022 at 2:47 PM, V3ct0r said:

You can find some functions that need to be changed in the CO sources, in the hook.h file. Also specific changes can be found in the dllmain.cpp file.

 

  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...