CONNEXION
  • RetourJeux
    • Sorties
    • Hit Parade
    • Les + populaires
    • Les + attendus
    • Soluces
    • Tous les Jeux
    • Gaming
  • RetourActu Gaming
    • News
    • Astuces
    • Tests
    • Previews
    • Toute l'actu gaming
  • RetourBons plans
    • Bons plans
    • Bons plans Smartphone
    • Bons plans Hardware
    • Bons plans Image et Son
    • Bons plans Amazon
    • Bons plans Cdiscount
    • Bons plans Decathlon
    • Bons plans Fnac
    • Tous les Bons plans
  • RetourJVTech
    • Actus High-Tech
    • Intelligence Artificielle
    • Smartphones
    • Mobilité urbaine
    • Hardware
    • Image et son
    • Tutoriels
    • Tests produits High-Tech
    • Guides d'achat High-Tech
    • JVTech
  • RetourCulture
    • Actus Culture
    • Culture
  • RetourVidéos
    • A la une
    • Gaming Live
    • Vidéos Tests
    • Vidéos Previews
    • Gameplay
    • Trailers
    • Chroniques
    • Replay Web TV
    • Toutes les vidéos
  • RetourForums
    • Hardware PC
    • PS5
    • Switch 2
    • Xbox Series
    • Switch
    • Pokemon pocket
    • FC 25 Ultimate Team
    • League of Legends
    • Tous les Forums
  • PC
  • PS5
  • Xbox Series
  • Switch 2
  • PS4
  • One
  • Switch
  • iOS
  • Android
  • MMO
  • RPG
  • FPS
En ce moment Genshin Impact Valhalla Breath of the wild Animal Crossing GTA 5 Red dead 2
Forum
  • Accueil
  • Actus
  • Tests
  • Vidéos
  • Images
  • Soluces
  • Forum
Liste des sujets

World UO

Harvest-lune
Harvest-lune
Niveau 6
21 décembre 2002 à 02:05:38

/*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
|| This file is part of the World UO Server Emulator ||
|| ||
|| This software is free software released under GPL2 license. ||
|| You can find detailed license information in World UO.cpp file. ||
|| ||
|| For any question post to World UO forums ||

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
|| FILE PURPOSE : ||
|| ||
|| ||
|| ||

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
|| ||

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
|| ||
|| CHANGELOG ||
||
--------------------------------------------------
------------------------ ||
|| Date Developer Description ||
||
--------------------------------------------------
------------------------ ||
|| 04 Aug 02 Juliunus Prevented noxdates from printing to console ||
|| Also modified output format ||

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/

  1. include "common.h"
  2. include "debug.h"
  3. include <signal.h>
  4. include "version.h"
  1. include <stdio.h>
  2. include <stdarg.h>
  3. include "console.h"
  4. ifdef _WINDOWS
  5. include "gui.h"
  6. endif

static FILE *s_fileStdOut = NULL;
static char s_strSrvcMsg[8192];

void clearscreen( void )
{

ConOut("_________________________________________
_________________________________\n\n");
}

void setWinTitle(char *str, . ..)
{
if ( ServerScp::g_nDeamonMode!=0) return;

char temp[TEMP_STR_SIZE]; //xan -> this overrides the global temp var
va_list argptr;

va_start( argptr, str ) ;
vsprintf( temp, str, argptr ) ;
va_end( argptr ) ;

#ifdef __unix__
ConOut("\033]0;%s\007", temp); // xterm code
#endif
#ifdef WIN32
#ifdef _WINDOWS
SetWindowText(g_HWnd, ( char*)temp);
#endif
#ifdef _CONSOLE
SetConsoleTitle((char*)temp);
#endif
#endif
}

void constart( void )
{
if ( ServerScp::g_nLoadDebugger!=0) {
setWinTitle("%s %s - [debug mode] [run]", PRODUCT, VERNUMB);
} else {
setWinTitle("%s %s", PRODUCT, VERNUMB);
}
#ifndef __unix__
#ifndef _WINDOWS
if ( ServerScp::g_nDeamonMode==0) {
HANDLE Buff = GetStdHandle(STD_OUTPUT_HANDLE);
COORD coord; coord.X = 80; coord.Y = ( short)ServerScp::g_nLineBuffer;
WORD arr[80];
DWORD w;

SetConsoleScreenBufferSize(Buff, coord);

unsigned short color;

color=FOREGROUND_BLUE|FOREGROUND_RED|FOREGROUND_
GREEN;

SetConsoleTextAttribute(Buff,color);

coord.X = coord.Y = 0;
for ( int i = 0; i<80; i++)
arr[i] = color;

for ( coord.Y = 0; coord.Y<1024; coord.Y++) WriteConsoleOutputAttribute(Buff, ( CONST WORD *)arr,80,coord,(LPDWORD ) &); // actual number written

}
#endif
#endif
}

void initConsole(void)
{
if
((ServerScp::g_nRedirectOutput)||(ServerScp::g_nDe
amonMode)) {
if(s_fileStdOut==NULL) s_fileStdOut = fopen(ServerScp::g_szOutput,"wt");
if(s_fileStdOut==NULL) s_fileStdOut = fopen("nxwout","wt");
if(s_fileStdOut==NULL) exit(1);
} else s_fileStdOut = stdout;
}

extern "C" void ConOut(char *txt, . ..)
{
va_list argptr;

va_start( argptr, txt ) ;
vsprintf( s_strSrvcMsg, txt, argptr ) ;
va_end( argptr ) ;

  1. ifndef _WINDOWS

fprintf(s_fileStdOut, s_strSrvcMsg);
fflush(s_fileStdOut);

  1. else

xwprintf("%s", s_strSrvcMsg);

  1. endif

}

extern void setWinTitle(char *str, . ..);

extern "C" void SDbgIn(char *s, int n)
{
if ( ServerScp::g_nDeamonMode!=0) {
ConOut("ALERT : INPUT REQUESTED IN SERVICE");
sprintf(s, "--Unknown Input--");
}

setWinTitle("%s %s - [debug mode] [break]", PRODUCT, VERNUMB);

  1. ifndef _WINDOWS

if ( ServerScp::g_nDeamonMode==0) {
#ifdef _CONSOLE
HANDLE Buff = GetStdHandle(STD_OUTPUT_HANDLE);
unsigned short color;

color=FOREGROUND_RED|FOREGROUND_BLUE|FOREGROUN
D_INTENSITY;
SetConsoleTextAttribute(Buff,color);
#endif //Win-CONSOLE
fgets(s,n,stdin);
#ifdef _CONSOLE

color=FOREGROUND_RED|FOREGROUND_GREEN|FOREGROU
ND_BLUE;
SetConsoleTextAttribute(Buff,color);
#endif //Win-CONSOLE
}

  1. else //Win-GUI

xwgets(s, n);

  1. endif //Win-GUI

setWinTitle("%s %s - [debug mode] [run]", PRODUCT, VERNUMB);
}

extern "C" void SDbgOut(char *txt, . ..) // Juliunus : changed this function to add color
{
va_list argptr;

va_start( argptr, txt ) ;
vsprintf( s_strSrvcMsg, txt, argptr ) ;
va_end( argptr ) ;

  1. ifndef _WINDOWS
  1. ifdef _CONSOLE

if ( ServerScp::g_nDeamonMode==0) {
HANDLE Buff = GetStdHandle(STD_OUTPUT_HANDLE);
unsigned short color;
color=FOREGROUND_GREEN|FOREGROUND_RED;
SetConsoleTextAttribute(Buff,color);
}

  1. endif

fprintf(s_fileStdOut, "%s", s_strSrvcMsg);
fflush(s_fileStdOut);

  1. ifdef _CONSOLE

if ( ServerScp::g_nDeamonMode==0) {
HANDLE Buff = GetStdHandle(STD_OUTPUT_HANDLE);
unsigned short color;

color=FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND
_BLUE;
SetConsoleTextAttribute(Buff,color);
}

  1. endif
  1. else

if ( s_strSrvcMsg[0]!=´=´) xwprintf("\x80%s", s_strSrvcMsg);
else xwprintf("\x80%s", s_strSrvcMsg);

  1. endif

}

extern "C" void STraceOut(char *txt, . ..)
{
va_list argptr;

va_start( argptr, txt ) ;
vsprintf( s_strSrvcMsg, txt, argptr ) ;
va_end( argptr ) ;

  1. ifndef _WINDOWS
  1. ifdef _CONSOLE

if ( ServerScp::g_nDeamonMode==0) {
HANDLE Buff = GetStdHandle(STD_OUTPUT_HANDLE);
unsigned short color;
color=FOREGROUND_BLUE|FOREGROUND_INTENSITY;
SetConsoleTextAttribute(Buff,color);
}

  1. endif

fprintf(s_fileStdOut, "%s", s_strSrvcMsg);
fflush(s_fileStdOut);

  1. ifdef _CONSOLE

if ( ServerScp::g_nDeamonMode==0) {
HANDLE Buff = GetStdHandle(STD_OUTPUT_HANDLE);
unsigned short color;

color=FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND
_BLUE;
SetConsoleTextAttribute(Buff,color);
}

  1. endif
  1. else

xwprintf("\x81%s", s_strSrvcMsg);

  1. endif

}

static char s_szErrMsg[2048];
static char s_szNoXDate[128];

char* getNoXDate()
{
time_t TIME;
tm* T;
time(&);
T = localtime(&);

sprintf(s_szNoXDate, "%02d%02d%02d%02d%02d%02d", T->tm_year%100,T->tm_mon+1, T->tm_mday,
T->tm_hour, T->tm_min, T->tm_sec);

return s_szNoXDate;
}

/*************************************************

    • ***

** NEW GEN Console Functions **

    • ***********************************************
    • **/

extern "C" void AnsiOut(char *txt)
{
#ifdef __unix__
#ifdef USEANSICODES
ConOut(txt);
#endif
#endif
}

extern "C" void ErrOut(char *txt, . ..)
{
va_list argptr;

va_start( argptr, txt ) ;
vsprintf( s_szErrMsg, txt, argptr ) ;
va_end( argptr ) ;

AnsiOut("\x1B[1;31m");
// ConOut("E %s - %s", getNoXDate(), s_szErrMsg);
ConOut("[ERROR] %s", s_szErrMsg);
AnsiOut("\x1B[0m");
}

extern "C" void WarnOut(char *txt, . ..)
{
va_list argptr;

va_start( argptr, txt ) ;
vsprintf( s_szErrMsg, txt, argptr ) ;
va_end( argptr ) ;

AnsiOut("\x1B[1;33m");
// ConOut("W %s - %s", getNoXDate(), s_szErrMsg);
// ConOut("[WARNING] %s", s_szErrMsg);
SDbgOut("[WARNING] %s", s_szErrMsg);
AnsiOut("\x1B[0m");
}

extern "C" void InfoOut(char *txt, . ..)
{
va_list argptr;

va_start( argptr, txt ) ;
vsprintf( s_szErrMsg, txt, argptr ) ;
va_end( argptr ) ;
AnsiOut("\x1B[1;34m");
// ConOut("i %s - %s", getNoXDate(), s_szErrMsg);
ConOut("[INFO] %s", s_szErrMsg);
AnsiOut("\x1B[0m");
}

extern "C" void PanicOut(char *txt, . ..)
{
va_list argptr;

va_start( argptr, txt ) ;
vsprintf( s_szErrMsg, txt, argptr ) ;
va_end( argptr ) ;

AnsiOut("\x1B[1;31m");
// ConOut("! %s - %s", getNoXDate(), s_szErrMsg);
SDbgOut("[PANIC!] %s", s_szErrMsg);
AnsiOut("\x1B[0m");
}

extern "C" void DmpOut(char *txt, . ..)
{
va_list argptr;

va_start( argptr, txt ) ;
vsprintf( s_szErrMsg, txt, argptr ) ;
va_end( argptr ) ;

AnsiOut("\x1B[33m");
ConOut("--> %s", s_szErrMsg);
AnsiOut("\x1B[0m");
}

Popuri
Popuri
Niveau 6
21 décembre 2002 à 21:59:40

hey c full hot jvais avoir uo ( renaissance)a noel
jtripe c full coooool

pis c quoi tessaye de dire harverst lune??
jcomprend rien pantoute

c quoi ton email

-pot-pourri nouvelle odeur d´anana et fromage moisi!!!

miniroxy
miniroxy
Niveau 9
21 décembre 2002 à 23:08:26

? ??????g rien compris de cke to ecrit tom....c bin oht mais un perte de temps:P lol

yerk ta nouvelle savuer popo...mmddrrr

Harvest-lune
Harvest-lune
Niveau 6
21 décembre 2002 à 23:44:54

et bien je présentais mon projet;p
World UO
je vous est donner une petit partie du languague qu´il contient