HomePortalFAQSearchMemberlistUsergroupsRegisterLog in
The domain www.kitopen.com will expire on 2018-08-17. Update your bookmarks to point at http://kito.forumotion.com/
Meet the new KITO admins & hear their plans here.
You can use google search to find threads and posts here now. Example

Share | 
 

 Raknet Issues

Go down 
AuthorMessage
Furrest

avatar

Game username : Furrest(Everywhere Else) / Frozenfur (Only On DD)
Server : Mythical Realms (Owner/Creator)
Female Posts : 80
Join date : 2015-11-11
Age : 16
Location : United States

PostSubject: Raknet Issues   Fri Mar 30, 2018 6:28 am

Hello everyone! Let me just explain a little something before I get right into the issue I think it would make more sense as to why I'm doing this. My source that I was using had everything I needed, but different colored paw pads didnt work. So, I went to my very old source and added everything I needed in and so all I have to do is add levels, shops, and NPCs. I copy pasted everything where it needed to go into my old source aka the one Im using now because paw pads work and I get errors.



These are all my errors and for some reason when I click on the errors up top which I assume are suppose to be what needs to be fixed because the errors down below are the reason why it's doing this I guess.

Down here is what my broken paw pad RakMemoryOverride.h looks like

Code:
#ifndef __RAK_MEMORY_H
#define __RAK_MEMORY_H

#include "Export.h"
#include "RakNetDefines.h"

#ifdef _XBOX360
#elif defined (_PS3)
// Causes linker errors
// #include <stdlib.h>
typedef unsigned int size_t;
#elif defined ( __APPLE__ ) || defined ( __APPLE_CC__ )
#include <malloc/malloc.h>
#elif defined(_WIN32)
#include <malloc.h>
#else
#if !defined ( __FreeBSD__ )
#include <alloca.h>
#endif
#include <stdlib.h>
#endif

extern void* (*rakMalloc) (size_t size);
extern void* (*rakRealloc) (void *p, size_t size);
extern void (*rakFree) (void *p);
extern void (*notifyOutOfMemory) (const char *file, const long line);

namespace RakNet
{

class RAK_DLL_EXPORT RakMemoryOverride
{
public:
#ifdef _USE_RAK_MEMORY_OVERRIDE
 static void* operator new (size_t size);
 static void operator delete (void *p);
 static void* operator new[] (size_t size);
 static void operator delete[] (void *p);
#endif

 static void* RakMalloc (size_t size);
 static void* RakRealloc (void *p, size_t size);
 static void RakFree (void *p);
 
};

}

#endif

Then here's the one I'm fiddling with

Code:
/// \file
/// \brief If _USE_RAK_MEMORY_OVERRIDE is defined, memory allocations go through rakMalloc, rakRealloc, and rakFree
///
/// This file is part of RakNet Copyright 2003 Jenkins Software LLC
///
/// Usage of RakNet is subject to the appropriate license agreement.


#ifndef __RAK_MEMORY_H
#define __RAK_MEMORY_H

#include "Export.h"
#include "RakNetDefines.h"
#include <new>

#include "RakAlloca.h"

// #if _USE_RAK_MEMORY_OVERRIDE==1
// #if defined(new)
// #pragma push_macro("new")
// #undef new
// #define RMO_NEW_UNDEF
// #endif
// #endif


// These pointers are statically and globally defined in RakMemoryOverride.cpp
// Change them to point to your own allocators if you want.
// Use the functions for a DLL, or just reassign the variable if using source
extern RAK_DLL_EXPORT void * (*rakMalloc) (size_t size);
extern RAK_DLL_EXPORT void * (*rakRealloc) (void *p, size_t size);
extern RAK_DLL_EXPORT void (*rakFree) (void *p);
extern RAK_DLL_EXPORT void * (*rakMalloc_Ex) (size_t size, const char *file, unsigned int line);
extern RAK_DLL_EXPORT void * (*rakRealloc_Ex) (void *p, size_t size, const char *file, unsigned int line);
extern RAK_DLL_EXPORT void (*rakFree_Ex) (void *p, const char *file, unsigned int line);
extern RAK_DLL_EXPORT void (*notifyOutOfMemory) (const char *file, const long line);
extern RAK_DLL_EXPORT void * (*dlMallocMMap) (size_t size);
extern RAK_DLL_EXPORT void * (*dlMallocDirectMMap) (size_t size);
extern RAK_DLL_EXPORT int (*dlMallocMUnmap) (void* ptr, size_t size);

// Change to a user defined allocation function
void RAK_DLL_EXPORT SetMalloc( void* (*userFunction)(size_t size) );
void RAK_DLL_EXPORT SetRealloc( void* (*userFunction)(void *p, size_t size) );
void RAK_DLL_EXPORT SetFree( void (*userFunction)(void *p) );
void RAK_DLL_EXPORT SetMalloc_Ex( void* (*userFunction)(size_t size, const char *file, unsigned int line) );
void RAK_DLL_EXPORT SetRealloc_Ex( void* (*userFunction)(void *p, size_t size, const char *file, unsigned int line) );
void RAK_DLL_EXPORT SetFree_Ex( void (*userFunction)(void *p, const char *file, unsigned int line) );
// Change to a user defined out of memory function
void RAK_DLL_EXPORT SetNotifyOutOfMemory( void (*userFunction)(const char *file, const long line) );
void RAK_DLL_EXPORT SetDLMallocMMap( void* (*userFunction)(size_t size) );
void RAK_DLL_EXPORT SetDLMallocDirectMMap( void* (*userFunction)(size_t size) );
void RAK_DLL_EXPORT SetDLMallocMUnmap( int (*userFunction)(void* ptr, size_t size) );

extern RAK_DLL_EXPORT void * (*GetMalloc()) (size_t size);
extern RAK_DLL_EXPORT void * (*GetRealloc()) (void *p, size_t size);
extern RAK_DLL_EXPORT void (*GetFree()) (void *p);
extern RAK_DLL_EXPORT void * (*GetMalloc_Ex()) (size_t size, const char *file, unsigned int line);
extern RAK_DLL_EXPORT void * (*GetRealloc_Ex()) (void *p, size_t size, const char *file, unsigned int line);
extern RAK_DLL_EXPORT void (*GetFree_Ex()) (void *p, const char *file, unsigned int line);
extern RAK_DLL_EXPORT void *(*GetDLMallocMMap())(size_t size);
extern RAK_DLL_EXPORT void *(*GetDLMallocDirectMMap())(size_t size);
extern RAK_DLL_EXPORT int (*GetDLMallocMUnmap())(void* ptr, size_t size);

namespace RakNet
{

 template <class Type>
 RAK_DLL_EXPORT Type* OP_NEW(const char *file, unsigned int line)
 {
#if _USE_RAK_MEMORY_OVERRIDE==1
 char *buffer = (char *) (GetMalloc_Ex())(sizeof(Type), file, line);
 Type *t = new (buffer) Type;
 return t;
#else
 (void) file;
 (void) line;
 return new Type;
#endif
 }

 template <class Type, class P1>
 RAK_DLL_EXPORT Type* OP_NEW_1(const char *file, unsigned int line, const P1 &p1)
 {
#if _USE_RAK_MEMORY_OVERRIDE==1
 char *buffer = (char *) (GetMalloc_Ex())(sizeof(Type), file, line);
 Type *t = new (buffer) Type(p1);
 return t;
#else
 (void) file;
 (void) line;
 return new Type(p1);
#endif
 }

 template <class Type, class P1, class P2>
 RAK_DLL_EXPORT Type* OP_NEW_2(const char *file, unsigned int line, const P1 &p1, const P2 &p2)
 {
#if _USE_RAK_MEMORY_OVERRIDE==1
 char *buffer = (char *) (GetMalloc_Ex())(sizeof(Type), file, line);
 Type *t = new (buffer) Type(p1, p2);
 return t;
#else
 (void) file;
 (void) line;
 return new Type(p1, p2);
#endif
 }

 template <class Type, class P1, class P2, class P3>
 RAK_DLL_EXPORT Type* OP_NEW_3(const char *file, unsigned int line, const P1 &p1, const P2 &p2, const P3 &p3)
 {
#if _USE_RAK_MEMORY_OVERRIDE==1
 char *buffer = (char *) (GetMalloc_Ex())(sizeof(Type), file, line);
 Type *t = new (buffer) Type(p1, p2, p3);
 return t;
#else
 (void) file;
 (void) line;
 return new Type(p1, p2, p3);
#endif
 }

 template <class Type, class P1, class P2, class P3, class P4>
 RAK_DLL_EXPORT Type* OP_NEW_4(const char *file, unsigned int line, const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4)
 {
#if _USE_RAK_MEMORY_OVERRIDE==1
 char *buffer = (char *) (GetMalloc_Ex())(sizeof(Type), file, line);
 Type *t = new (buffer) Type(p1, p2, p3, p4);
 return t;
#else
 (void) file;
 (void) line;
 return new Type(p1, p2, p3, p4);
#endif
 }


 template <class Type>
 RAK_DLL_EXPORT Type* OP_NEW_ARRAY(const int count, const char *file, unsigned int line)
 {
 if (count==0)
 return 0;

#if _USE_RAK_MEMORY_OVERRIDE==1
// Type *t;
 char *buffer = (char *) (GetMalloc_Ex())(sizeof(int)+sizeof(Type)*count, file, line);
 ((int*)buffer)[0]=count;
 for (int i=0; i<count; i++)
 {
 //t =
 new(buffer+sizeof(int)+i*sizeof(Type)) Type;
 }
 return (Type *) (buffer+sizeof(int));
#else
 (void) file;
 (void) line;
 return new Type[count];
#endif

 }

 template <class Type>
 RAK_DLL_EXPORT void OP_DELETE(Type *buff, const char *file, unsigned int line)
 {
#if _USE_RAK_MEMORY_OVERRIDE==1
 if (buff==0) return;
 buff->~Type();
 (GetFree_Ex())((char*)buff, file, line );
#else
 (void) file;
 (void) line;
 delete buff;
#endif

 }

 template <class Type>
 RAK_DLL_EXPORT void OP_DELETE_ARRAY(Type *buff, const char *file, unsigned int line)
 {
#if _USE_RAK_MEMORY_OVERRIDE==1
 if (buff==0)
 return;

 int count = ((int*)((char*)buff-sizeof(int)))[0];
 Type *t;
 for (int i=0; i<count; i++)
 {
 t = buff+i;
 t->~Type();
 }
 (GetFree_Ex())((char*)buff-sizeof(int), file, line );
#else
 (void) file;
 (void) line;
 delete [] buff;
#endif

 }

 void RAK_DLL_EXPORT * _RakMalloc (size_t size);
 void RAK_DLL_EXPORT * _RakRealloc (void *p, size_t size);
 void RAK_DLL_EXPORT _RakFree (void *p);
 void RAK_DLL_EXPORT * _RakMalloc_Ex (size_t size, const char *file, unsigned int line);
 void RAK_DLL_EXPORT * _RakRealloc_Ex (void *p, size_t size, const char *file, unsigned int line);
 void RAK_DLL_EXPORT _RakFree_Ex (void *p, const char *file, unsigned int line);
 void RAK_DLL_EXPORT * _DLMallocMMap (size_t size);
 void RAK_DLL_EXPORT * _DLMallocDirectMMap (size_t size);
 int RAK_DLL_EXPORT _DLMallocMUnmap (void *p, size_t size);

}

// Call to make RakNet allocate a large block of memory, and do all subsequent allocations in that memory block
// Initial and reallocations will be done through whatever function is pointed to by yourMMapFunction, and yourDirectMMapFunction (default is malloc)
// Allocations will be freed through whatever function is pointed to by yourMUnmapFunction (default free)
void UseRaknetFixedHeap(size_t initialCapacity,
 void * (*yourMMapFunction) (size_t size) = RakNet::_DLMallocMMap,
 void * (*yourDirectMMapFunction) (size_t size) = RakNet::_DLMallocDirectMMap,
 int (*yourMUnmapFunction) (void *p, size_t size) = RakNet::_DLMallocMUnmap);

// Free memory allocated from UseRaknetFixedHeap
void FreeRakNetFixedHeap(void);

// #if _USE_RAK_MEMORY_OVERRIDE==1
// #if defined(RMO_NEW_UNDEF)
// #pragma pop_macro("new")
// #undef RMO_NEW_UNDEF
// #endif
// #endif

#endif

I dont understand why they're so different and it's literally the same file. I've been trying to fix this for a few hours. Any help would be appreciated. Thanks! (using 5.0 source for both)
Back to top Go down
http://mythical-realms.freeforums.net
RedEye
Retired
avatar

Game username : -redeye-
Server : KITO
Male Posts : 2584
Join date : 2011-07-24
Age : 31

PostSubject: Re: Raknet Issues   Fri Mar 30, 2018 11:13 am

It seems you're mixing 5.5 and some other version.
Notice the dependencies:
* 5.5: https://github.com/jespersh/KITO/tree/v5.5/deps
* 6.0: https://github.com/jespersh/KITO/tree/v6.0/deps
* 5.3: https://github.com/jespersh/KITO/tree/v5.3/deps

________________________________
Retired
Back to top Go down
Furrest

avatar

Game username : Furrest(Everywhere Else) / Frozenfur (Only On DD)
Server : Mythical Realms (Owner/Creator)
Female Posts : 80
Join date : 2015-11-11
Age : 16
Location : United States

PostSubject: Re: Raknet Issues   Fri Mar 30, 2018 11:55 am

RedEye wrote:
It seems you're mixing 5.5 and some other version.
Notice the dependencies:
* 5.5: https://github.com/jespersh/KITO/tree/v5.5/deps
* 6.0: https://github.com/jespersh/KITO/tree/v6.0/deps
* 5.3: https://github.com/jespersh/KITO/tree/v5.3/deps

How do I update my source to fix it?
Back to top Go down
http://mythical-realms.freeforums.net
Ashlyn Sheypher



Server : Galaxy of Infinity
Female Posts : 248
Join date : 2011-08-27
Age : 18
Location : Russian Federation

PostSubject: Re: Raknet Issues   Fri Mar 30, 2018 6:33 pm

Look through the forum, you'll find a tutorial about updating to the 6.0 version, it seems to be located in Tutorials section.
Back to top Go down
Ashlyn Sheypher



Server : Galaxy of Infinity
Female Posts : 248
Join date : 2011-08-27
Age : 18
Location : Russian Federation

PostSubject: Re: Raknet Issues   Fri Mar 30, 2018 6:34 pm

Found it: http://www.kitopen.com/t3461-guide-how-to-update-your-existing-code-to-6-0-version
Back to top Go down
Sponsored content




PostSubject: Re: Raknet Issues   

Back to top Go down
 
Raknet Issues
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Keeping I.T. Open :: SUPPORT :: Support-
Jump to: