{ *********************************************************************** }
{                                                                         }
{ Copular Chat Server v3.0 Source Code                                    }
{ Project Unit                                                            }
{                                                                         }
{ Copyright (c) 1998-2002 SAF Studio                                      }
{                                                                         }
{ Author  : Niu Yu Ping                                                   }
{ Nickname: DecimalOX                                                     }
{ Address : Jilin City China                                              }
{                                                                         }
{ QICQ    : 103106262                                                     }
{ Homepage: www.safree.com                                                }
{ EMail   : decimalox@sohu.com                                            }
{                                                                         }
{ *********************************************************************** }

program Server;



uses
  Forms,
  Windows,
  Server_Main in 'Server_Main.pas' {Form1},
  Core in '..\Core\Core.pas';

{$R *.RES}

var
  hMutex:HWND;
  ECode:Integer;

begin
  Application.Initialize;
  Application.Title := 'Copular Chat Server v3.0';
  hMutex:=CreateMutex(nil,False,'Copular Chat Server v3.0');
  ECode:=GetLastError;

  //if another process of the server is running then exit
  if ECode<>ERROR_ALREADY_EXISTS then
  begin
    Application.CreateForm(TForm1, Form1);
  Application.Run;
  end
  else
    MessageBox(0,'已经有一个聊天室服务程序在运行了','信息',MB_OK or MB_ICONINFORMATION);
  ReleaseMutex(hMutex);
end.
