Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#include "Headers/Server.h"

// TODO: make this scene independent! -Ionut
#include "Scenes/NetworkScene/Headers/tcp_session_impl.h"

#include <iostream>

using namespace boost::asio;

namespace Divide {

Server::Server() {}

Server::~Server() {
    acceptor_->close();
    delete acceptor_;
}

void Server::init(U16 port, const stringImpl& broadcast_endpoint_address, bool debugOutput) {
    _debugOutput = debugOutput;
    try {
        tcp::endpoint listen_endpoint(tcp::v4(), port);
        udp::endpoint broadcast_endpoint(
            boost::asio::ip::address::from_string(broadcast_endpoint_address.c_str()),
            port);
        acceptor_ = new tcp::acceptor(io_service_, listen_endpoint);
        subscriber_ptr bc(new udp_broadcaster(io_service_, broadcast_endpoint));
        _channel.join(bc);
        tcp_session_ptr new_session(
            new tcp_session_impl(io_service_, _channel));

        acceptor_->async_accept(
            new_session->getSocket(),
            boost::bind(&Server::handle_accept, this, new_session, _1));
        std::auto_ptr<boost::asio::io_service::work> work(
            new boost::asio::io_service::work(io_service_));
        io_service_.run();
    } catch (std::exception& e) {
        std::cout << "SERVER: " << e.what() << std::endl;
    }
}

void Server::handle_accept(tcp_session_ptr session,
                           const boost::system::error_code& ec) {
    if (!ec) {
        if (_debugOutput) std::cout << "New TCP session accepted" << std::endl;
        session->start();

        tcp_session_ptr new_session(
            new tcp_session_impl(io_service_, _channel));

        acceptor_->async_accept(
            new_session->getSocket(),
            boost::bind(&Server::handle_accept, this, new_session, _1));
    } else {
        std::cout << "ERROR: " << ec << std::endl;
    }
}

};  // namespace Divide

Commits for Divide-Framework/trunk/Source Code/Server/Server.cpp

Diff revisions: vs.
Revision Author Commited Message
827 Diff Diff IonutCava picture IonutCava Sun 22 Jan, 2017 21:59:36 +0000

[IonutCava]
- ShaderBuffers now decide heuristically if they get persistently mapped or not (depends on size. Current limit is 512Kb for subData calls.
- Separate visible node command generation into 2 steps: onRender and getDrawPackage. onRender allows the creation of parallel tasks that should finish by the time the second call, getDrawPackage reaches the same node
- Update ParticleEmitter to take into account multiple players and increase parallelism at the cost of memory consumption and complexity.
- Add a default bounding box for Players (add extents to SceneTransform nodes)
- All buffers (ShaderBuffer, d3dConstantBuffer, glUniformBuffer, glBufferImpl, glGenericBuffer, etc) use BufferParams for creation.
— Constructor and create calls have been merged together

671 Diff Diff IonutCava picture IonutCava Fri 08 Apr, 2016 16:26:49 +0000

[Ionut]
- Custom memory allocation system part 1:
— Add http://www.codeproject.com/Articles/1089905/A-Custom-STL-std-allocator-Replacement-Improves-Pe
— Add custom allocators to strings and vectors
— Add custom allocators to a few test classes
— No support for aligned memory yet, so vec4<F32> and mat4<F32> vectors use the old allocation system
- Replace more std::async call with our custom task system

466 Diff Diff IonutCava picture IonutCava Fri 05 Jun, 2015 15:07:17 +0000

[Ionut]
- Moved EASTL, SimpleINI and Threadpool libraries from Dependencies repo to engine repo
- Disabled EASTL string and vector support as they are really out of date and missing required features.
— EASTL hash map is still usable

404 Diff Diff IonutCava picture IonutCava Sun 19 Apr, 2015 20:37:32 +0000

[Ionut]
- Threading work regarding texture loading (W.I.P.)
- Animation system cleanup (W.I.P.)
- ShaderManager shutdown cleanup improvements

353 Diff Diff IonutCava picture IonutCava Tue 17 Feb, 2015 17:08:27 +0000

[Ionut]
- Compatibility updates for Boost 1.57 (some warnings still exist for now)
- Fixed some non-conforming code
- Added ALL OF THE MISSING FILES FROM THE LAST 15 commits ...........

350 Diff Diff IonutCava picture IonutCava Tue 10 Feb, 2015 16:25:39 +0000

[Ionut]
- Simplified some Util-namespace level functions by using STL algorithms where possible
- Formatted the entire codebase using clang-format with the following style: "{BasedOnStyle: Google, IndentWidth: 4}"
- Attempted to make ProfileTimer thread-safe (temp fix until std::chrono works properly in Visual Studio)

334 IonutCava picture IonutCava Wed 10 Dec, 2014 17:21:22 +0000

[Ionut]
- Reorganized the Hardware project and renamed to "Platform"
- Reorganized the Server project