Register for your free account! | Forgot your password?

You last visited: Today at 01:40

  • Please register to post and access all features, it's quick, easy and FREE!

 

COPS v7 Emulator (v5065 C++/Qt4)

Reply
 
Old   #1

 
elite*gold: 0
Join Date: Jan 2008
Posts: 1,389
Received Thanks: 1,048
COPS v7 Emulator (v5065 C++/Qt4)

I worked a bit on a C++ emulator for the game Era of Faith, but decided to just retire myself from everything related to TQ. Anyway, I wasn't really developing actively anyway.

I decided to release the C++ emulator (not enough good references in this language), but EoF is not really known, so a CO2 fork is more appropriate. I took some time to fork my project for the patch 5065 and implement few other features to be considered fine enough to be a base.

This emulator is released under a 4-clause BSD license. Meaning that you're free to do whatever you want with this source, but it must keep the original license somewhere for paternity. When using this source, you must specify that you used software developed by Jean-Philippe Boivin (CptSky is okay too). Leechers won't probably respect the license which only state to give credits, but eh, at least I tried

Check the LICENSE file for more information about third party modules.

Code:
                               COPS v7 Emulator
                               ----------------

                   Copyright (C) 2012 - 2014 Jean-Philippe Boivin
              https://bitbucket.org/jpboivin/cops-v7-emulator/overview

Overview
--------

COPS v7 Emulator is a fork of Faith Emulator, a C++ emulator of the MMORPG
Era of Faith. COPS v7 Emulator is a fork targeting the MMORPG Conquer Online,
at the patch 5065.

The emulator is developed in C++ with Qt4 / Qt5.
N.B. The QMySQL driver must be build to use the QSQL module properly.

Features
--------

COPS v7 Emulator is currently released as a base source. Most functionalities
are not implemented or completed. However, some features have special and
interesting implementation.

+ Support any POSIX and/or WinAPI operating system with Qt
+ Support any architecture (little endian & big endian | 32 bit & 64 bit)
+ Separate worker for logging (see zfserv.log)
+ Self destructed environment (useful for singletons)
+ MySQL5 database based on the official one

+ Security module
  - Custom implementations for:
    * TQ's custom cipher
    * Blowfish (CFB64)
    * RC5 (32/12/16)
    * Diffie-Hellman exchange

+ Map module
  - Parallel loading of Data Map (DMap) files
    * MapManager will detect the number of physical cores and spawn an appropriate
      amount of worker to load DMaps in parallel.
      e.g. On two PowerPC 970MP (dual core) @ 2.5 GHz, 4 workers will be spawn and
           it will takes less than 30s to load all DMap of a 5065 client.
  - Compressed data when unused
    * Each GameMap will detect when no player will be on the map, and than pack
      the data using the LZ4 algorithm and unpack the data when required.
      e.g. With a PowerPC (64 bit), at idle, the emulator will require less than
           10 MB of RAM to keep all DMap of a 5065 client in memory.
  - Shared data among all GameMaps

+ Script module
  - Shared Lua VM for executing scripts
  - Exposed accessors for the player informations
  - Exposed specialized functions (e.g. text(), link())

+ Generator module
  - Based on TQ's one, using the official spawns will result in the same in-game spawns

+ Character creation
+ Character loading / saving
+ Direction / Emotion / Pk Mode
+ Walking / Jumping
+ Portals
+ Points allocation
+ Talking to NPCs [Incomplete]
+ Screen system [Incomplete]

+ Item features
  - Buying items from NPCs
  - Selling items to NPCs
  - Repairing items
  - Using / eating items
  - Equiping items
  - Real item ID generation for monsters [Incomplete]

Documentation about the emulator can be generated with dOxygen.
To generate the documentation, please in the root folder of the source,
and call dOxygen with Doxyfile.

Supported systems
-----------------

The emulator has been tested on the following platforms:
- Windows XP Professional (SP2)
  + x86_64 [Will compile, untested otherwise]
- Mac OS X Leopard (10.5.8)
  + ppc, ppc64
- Mac OS X Mavericks (10.9.2)
  + (x86), x86_x64
- Debian Lenny (5.0)
  + ARM (armel)

The emulator has been tested with Qt 4.6.3, 4.8.4 & 5.2.1.

However, the emulator should work without any modification on any
POSIX-compliant system (Mac OS X, *NIX, GNU/Linux, etc) and on any
WinAPI system.

N.B. This emulator uses the Windows API and/or the POSIX API and/or the Qt API.
Changelists:

Version 0.1 bug-fixes for Mac OS X.
Attached Files
File Type: zip COPS v7 Emulator - v0.1.zip (4.30 MB, 606 views)
File Type: zip COPS v7 Emulator - v0.2.zip (4.40 MB, 418 views)
File Type: zip COPS v7 Emulator - v0.2.1.zip (4.55 MB, 4428 views)



CptSky is offline  
Thanks
36 Users
Old   #2
 
elite*gold: 12
Join Date: Jul 2011
Posts: 6,799
Received Thanks: 3,285
*High fives*


Spirited is offline  
Thanks
2 Users
Old   #3
 
elite*gold: 0
Join Date: Oct 2007
Posts: 1,486
Received Thanks: 569
Zero experience in C++ here but gave you a thank for the great effort.
turk55 is online now  
Thanks
1 User
Old   #4

 
elite*gold: 0
Join Date: Jan 2008
Posts: 1,389
Received Thanks: 1,048
Quote:
Originally Posted by turk55 View Post
Zero experience in C++ here but gave you a thank for the great effort.
It's never too late to learn a new language


CptSky is offline  
Old   #5
 
elite*gold: 0
Join Date: Oct 2007
Posts: 1,486
Received Thanks: 569
Quote:
Originally Posted by CptSky View Post
It's never too late to learn a new language
Yeap, but requires time and that is something I barelly have at the moment. :P
turk55 is online now  
Old   #6
 
elite*gold: 0
Join Date: Feb 2011
Posts: 335
Received Thanks: 171
Great release jp
Arco. is offline  
Old   #7

 
elite*gold: 0
Join Date: Jan 2008
Posts: 1,389
Received Thanks: 1,048
Seems to be an issue with VS 2012. Anyone can confirm ?
CptSky is offline  
Old   #8
 
elite*gold: 0
Join Date: Sep 2013
Posts: 197
Received Thanks: 140
This is definitely some of the most beautiful code I've seen here on epvp. Good job.
SteveRambo is offline  
Old   #9

 
elite*gold: 0
Join Date: Jan 2008
Posts: 1,389
Received Thanks: 1,048
The atomic increment won't work on older versions of OS X (probably due to the deprecated version of GCC), I recommend editing the macro to :

Code:
#ifdef __APPLE__
#include <libkern/OSAtomic.h>
#endif // atomics


#if defined(__APPLE__)
#   if defined(TARGET_INSTR_X86_64) || defined(TARGET_INSTR_PPC64)
#       define atomic_inc(ptr) OSAtomicIncrement64Barrier(((volatile int64_t*)ptr))
#   else
#       define atomic_inc(ptr) OSAtomicIncrement32Barrier(((volatile int32_t*)ptr))
#   endif
#elif defined (_WIN32)
#   define atomic_inc(ptr) InterlockedIncrement((ptr))
#elif defined(__GNUC__)
#   define atomic_inc(ptr) (__sync_fetch_and_add((ptr), 1) + 1)
#else
#   error "Need some more porting work for atomic_inc."
#endif
CptSky is offline  
Old   #10
 
elite*gold: 0
Join Date: Jun 2007
Posts: 96
Received Thanks: 12
can't compile on QT version 5.2.1
screenshot >
(QT newbie)
atef201080 is offline  
Old   #11
 
elite*gold: 12
Join Date: Jul 2011
Posts: 6,799
Received Thanks: 3,285
Quote:
Originally Posted by atef201080 View Post
can't compile on QT version 5.2.1
screenshot >
(QT newbie)
Which is why you compile it with the correct version of QT.
Spirited is offline  
Old   #12
 
elite*gold: 0
Join Date: Jun 2007
Posts: 96
Received Thanks: 12
Quote:
Originally Posted by Spirited View Post
Which is why you compile it with the correct version of QT.
i think latest version is better and I'll find better features and more stability I've googled the error and found its linker issue.
-----------
after downloading QT 4 and searching for Mingw 4.4 for hours and installing it
i get the same errors when compiling

----------
adding
Code:
LIBS += -lwinmm
at .pro file fixed it with QT latest version...
atef201080 is offline  
Old   #13

 
elite*gold: 0
Join Date: Jan 2008
Posts: 1,389
Received Thanks: 1,048
Yes, if using MinGW, VS extensions are not supported, so winmm is not linked.

For the error of sync_fetch_add, you should change the macro in common.h to :

Code:
#if defined(__APPLE__)
#   if defined(TARGET_INSTR_X86_64) || defined(TARGET_INSTR_PPC64)
#       define atomic_inc(ptr) OSAtomicIncrement64Barrier(((volatile int64_t*)ptr))
#   else
#       define atomic_inc(ptr) OSAtomicIncrement32Barrier(((volatile int32_t*)ptr))
#   endif
#elif defined (_WIN32)
#   define atomic_inc(ptr) InterlockedIncrement((ptr))
#elif defined(__GNUC__)
#   define atomic_inc(ptr) (__sync_fetch_and_add((ptr), 1) + 1)
#else
#   error "Need some more porting work for atomic_inc."
#endif
CptSky is offline  
Thanks
1 User
Old   #14
 
elite*gold: 0
Join Date: Jun 2007
Posts: 96
Received Thanks: 12
Another error...
Quote:
D/[..\COPSv7\src\Database\database.cpp:loadAllMaps(): 497] Executing SQL: SELECT `id`, `doc_id`, `type`, `weather`, `portal_x`, `portal_y`, `reborn_map`, `reborn_portal`, `light` FROM `map`
E/[..\COPSv7\src\Database\database.cpp:loadAllMaps(): 532] Failed to execute the following cmd : "SELECT `id`, `doc_id`, `type`, `weather`, `portal_x`, `portal_y`, `reborn_map`, `reborn_portal`, `light` FROM `map`"
Error: Using unsupported buffer type: 3 (parameter: 3) QMYSQL3: Unable to bind outvalues
atef201080 is offline  
Old   #15

 
elite*gold: 0
Join Date: Jan 2008
Posts: 1,389
Received Thanks: 1,048
Quote:
Originally Posted by atef201080 View Post
Another error...
You're using a MySQL 3 driver... You must build the MySQL 5 driver.


CptSky is offline  
Thanks
1 User
Reply

Tags
5065, c++, cops v7, cptsky, qt



« Previous Thread | Next Thread »

Similar Threads
COPS v6 : Source & Tools [Custom Emulator]
So, as I'm no longer active in CO2 private server development, I'll release my lastest emulator. It is a custom source which include almost ALL...
163 Replies - CO2 PServer Guides & Releases
COPS v3 - Reborn Edition : Source & Tools [LOTF Emulator]
I was cleaning my hard drive and I found an old source. The source is based on LOTF. I used it during COPS v3 (August 2008 - June 2009). After, I...
29 Replies - CO2 PServer Guides & Releases
COPS v3 - Source & Tools [LOTF Emulator]
I reformatted a USB Key and found an old source dating of January 2009. The source is based on LOTF. I used it during COPS v3 (August 2008 - June...
4 Replies - CO2 PServer Guides & Releases
[Help]How i can make [welcome ms](v5065)
Hello everone, -Can anyone tell me how i can make a welcome msg which tabel in database? -i'll be in wait guys! Cya
5 Replies - CO2 PServer - Discussions / Questions



All times are GMT +2. The time now is 01:40.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Abuse
Copyright ©2018 elitepvpers All Rights Reserved.